package org.ace.dao.impl;

import org.ace.dao.PlayeritemDAO;
import org.ace.dao.model.Playeritem;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class PlayeritemDAOImpl extends SqlMapClientDaoSupport implements PlayeritemDAO {

    public PlayeritemDAOImpl() {
        super();
    }

    public void save(Playeritem playeritem) {
        getSqlMapClientTemplate().insert("playeritem.insert", playeritem);
    }

    public int update(Playeritem playeritem) {
        int rows = getSqlMapClientTemplate().update("playeritem.update", playeritem);
        return rows;
    }

    public Playeritem get(Integer itemid) {
        Playeritem key = new Playeritem();
        key.setItemid(itemid);
        Playeritem record = (Playeritem) getSqlMapClientTemplate().queryForObject("playeritem.select", key);
        return record;
    }

    public int remove(Integer itemid) {
        Playeritem key = new Playeritem();
        key.setItemid(itemid);
        int rows = getSqlMapClientTemplate().delete("playeritem.delete", key);
        return rows;
    }
}